<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of UC_Withdraw
 *
 * @author Alen
 */
class UC_WithdrawAction extends PyramidUCAction {
    //put your code here
    public function index(){
        
        if(!$this->USER['TradePassword']) redirect('未设置交易密码','?m=UC_TradePassword_Edit');
        if(!$this->USER['State']) redirect('账户已被锁定','?m=UC_AccountLog');
        $this->assign('check_pwd', isset($_SESSION['tradepwd']));
        $bizacc=new SoBizFinanceAccount();
        $acc=$bizacc->read_one($this->USER_NAME);
        $this->assign('blance', $acc['Blance']);
        $this->display();
    }
    
    public function save(){
        $biz=new SoBizWithDrawal();
        $msg=$biz->withdrawal($this->USER_NAME,request_string('amount'), request_string('BankCardID'), request_string('name'), request_string('BankName'), request_string('note'));
        
	redirect($msg=='SUCCESS'?'提现申请已提交，请等待管理人员确认!':$msg,'?m=UC_AccountLog');
    }
    
    public function checkpwd(){
        $this->check_tradepassword();
    }
}

?>
